package org.codingq92.kafka;

import jakarta.annotation.Resource;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

@Component
public class KafkaProducer<K, V> {

    @Resource
    private KafkaTemplate<K, V> kafkaTemplate;

    public void sendMessage(String topic, V message) {
        kafkaTemplate.send(topic, message);
    }
}
